using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class sport_simple_answer_lineMap : EntityTypeConfiguration<sport_simple_answer_line>
    {
        public sport_simple_answer_lineMap()
        {
            // Primary Key
            this.HasKey(t => t.sport_simple_line_id);

            // Properties
            this.Property(t => t.sport_name)
                .HasMaxLength(50);

            this.Property(t => t.note)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("sport_simple_answer_line");
            this.Property(t => t.sport_simple_line_id).HasColumnName("sport_simple_line_id");
            this.Property(t => t.sport_name).HasColumnName("sport_name");
            this.Property(t => t.sport_time).HasColumnName("sport_time");
            this.Property(t => t.sport_frequency).HasColumnName("sport_frequency");
            this.Property(t => t.tired_level).HasColumnName("tired_level");
            this.Property(t => t.sport_simple_answer_sheet_id).HasColumnName("sport_simple_answer_sheet_id");
            this.Property(t => t.note).HasColumnName("note");
            this.Property(t => t.sport_id).HasColumnName("sport_id");

            // Relationships
            this.HasOptional(t => t.sport_simple_answer_sheet)
                .WithMany(t => t.sport_simple_answer_line)
                .HasForeignKey(d => d.sport_simple_answer_sheet_id);

        }
    }
}
